t = seq(0.0,9999.0,1.0)
n = length(t)
x = rnorm(n,1,0.05)
err = rnorm(n,1,0.05)

for(i in 1:n)
{
	if(i%%1000 == 0)
	{
		x[i:(i+500)] = x[i:(i+500)] - 0.5
	}
}
x[1:(1+500)] = x[1:(1+500)] - 0.5 ###This line accounts for the fact that the period doesn't wrap


x = x[1:n]
t = t[1:n]

plot(t,x,type="l")

z = data.frame(t, x, err)
write.table(z, "lc.txt", col.names=FALSE, row.names=FALSE)
